local sk__langgu = fk.CreateSkill {

  name = "sk__langgu",

  tags = {  },

}



sk__langgu:addEffect(fk.Damage, {
  name = "sk__langgu",
  anim_type = "masochism",
  can_trigger = function(self, event, target, player, data)
    return target and player:hasSkill(sk__langgu.name) and (target == player or data.to == player) and data.from ~= data.to
  end,
  on_cost = function(self, event, target, player, data)
    local to = data.to
    if target ~= player then
      to = data.from
    end
    if player.room:askForSkillInvoke(player, sk__langgu.name, nil, "#sk__langgu-invoke::"..to.id) then
      event:setCostData(self, to)
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local to = event:getCostData(self)
    room:doIndicate(player.id, {to.id})
    local judge = {
      who = target,
      reason = sk__langgu.name,
      pattern = ".|.|spade,club",
    }
    room:judge(judge)
    if to.dead or player.dead or to:isNude() then return end
    if judge.card.color == Card.Black then
      local card = room:askForCardChosen(player, to, "he", sk__langgu.name, "#sk__langgu-prey::"..to.id)
      room:moveCardTo(card, Card.PlayerHand, player, fk.ReasonPrey, sk__langgu.name, nil, false, player)
    end
  end,
})

return sk__langgu